# 将名片管理系统中的每个功能设计成对应的函数.
cards = [
    {'name':'张三','tel':'17715154242','job':'CEO','addr':'天府新谷','company':'源码时代'}
]
# 添加名片
"""
def add_newcard_info():
    new_name =input('请输入姓名:')
    new_tel =input('请输入手机号:')
    new_job =input('请输入职位:')
    new_addr =input('请输入地址:')
    new_company =input('请输入公司:')

    new_info = {}
    new_info['name']  = new_name
    new_info['tel']  = new_tel
    new_info['job']  = new_job
    new_info['addr']  = new_addr
    new_info['company']  = new_company
    cards.append(new_info)
    print(cards)

#调用这个函数即可用
add_newcard_info()
"""


# 删除名片

cards = [{'name':'汪林','tel':'17715154242','job':'CEO','addr':'天府新谷','company':'源码时代'}]
del_name = input('请输入要删除的姓名:')
find = 0    #默认没有找到
for info in cards:
    if del_name ==info['name']:
        find =1
        cards.remove(info)
        print('删除成功')
        break
else:
    print('没有信息')